Get a single string from two¶
Get a single string from two given strings, separated by a space
and swap the first two characters of each string.
Sample String:
‘abc’, ‘xyz’
Expected Result:
‘xyc abz’
def chars_mix_up(a, b):
S1 = b[:2] + a[2:]
S2 = a[:2] + b[2:]
return S1 + ' ' + S2
# test
print(chars_mix_up('abc', 'xyz')) # xyc abz